package com.team5.hydrone;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;

public class DashboardActivity extends Activity {
	String sesionUser;
	TextView lbl_welcome;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_dashboard);
		lbl_welcome = (TextView) findViewById(R.id.lbl_welcome);
		if (sesionUser == null) {
			// sesionUser = "admin";
			Intent intent = new Intent(this, LoginActivity.class);
			startActivityForResult(intent, 0);
		}

	}
	
	public void onActivityResult(){
		  Intent startingIntent = getIntent();
		  if (startingIntent != null) {
		    Bundle b = startingIntent.getBundleExtra("android.intent.extra.INTENT");
		    //recibimos la lista de cines
		    sesionUser = (String) getIntent().getSerializableExtra("userSesion");
		    lbl_welcome.setText("Bienvenido" + sesionUser);
		  }
		}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_dashboard, menu);
		return true;
	}

}
